//
// Created by jiaxv on 2025/8/8.
//

#ifndef LDACS_CORENET_DEFINE_H
#define LDACS_CORENET_DEFINE_H

#include <ld_santilizer.h>
#include <ld_statemachine.h>
#include "elements/elements.h"
#include "interface/define.h"

enum fsm_event_type {
        EV_DEFAULT = 0,
};

typedef struct fsm_args_s{
        void *data;
        net_element_t *net_ele;
        cn_format_desc_t *desc;
        element_propt_t *propt;
        interface_type_t intf_type;
}send_args_t;

enum GSG_FSM_STATES_E {
        GSG_INITIAL = 0,
        GSG_SAC_ALLOCING,
        GSG_CONNECTED,
        GSG_HO_OTHER,
        GSG_HO_CURRENT,
        GSG_EXIT,
};

extern fsm_event_t gsg_fsm_events[];

void init_gsg_fsm(sm_statemachine_t *sm);

enum AMM_FSM_STATES_E {
        AMM_INITIAL,
        AMM_AUTH,
        AMM_CONNECTING,
        AMM_CONNECTED,
        AMM_HO_PREPARE,
        AMM_HO_EXECUTE,
        AMM_EXIT
};

extern fsm_event_t amm_fsm_events[];
void init_amm_fsm(sm_statemachine_t *sm);

enum DBSM_FSM_STATES_E {
        DBSM_INITIAL,
        DBSM_CONNECTING,
        DBSM_CONNECTED,
        DBSM_HO,
        DBSM_EXIT
};

extern fsm_event_t dbsm_fsm_events[];
void init_dbsm_fsm(sm_statemachine_t *sm);

l_err default_cn_send_handler(net_element_t *net_ele, void *data, cn_format_desc_t *send_desc, element_propt_t *propt, interface_type_t intf_type);

l_err default_cn_forward_handler(net_element_t *net_ele, buffer_t *buf, element_propt_t *propt, interface_type_t intf_type);

#endif //LDACS_CORENET_DEFINE_H



